<template>
    <div>
        <!--<header>-->
        <!--<van-nav-bar title="home"/>-->
        <!--</header>-->
        <div class="top" @click="gotoCompanyAuth">
            <div class="headimg-id">
                    <div class="left">
                        <img :src="info.logo" alt="">
                        <div>
                            <p>{{info.name}}</p>
                            <!--<p class="subtile">岁月随心,终会淡然</p>-->
                        </div>
                    </div>
                    <div>
                        <div>
                            <i class="zx-icon">&#xe6be;</i>
                        </div>
                    </div>
            </div>
        </div>
        <div class="third-box">
           <div @click="gotoCompanyAuth" style="color:#269955;">
               <i class="zx-icon">&#xe600;</i>
               <span>已认证</span>
           </div>
            <div>
                <i class="zx-icon">&#xe676;</i>
                <span>历史发布</span>
            </div>
            <div @click.stop="gotoBill" class="item1">
                <i class="zx-icon">&#xe686;</i>
                <span>账单</span>
            </div>
        </div>
        <div class="item-list">
            <div class="box">
                <router-link class="item" tag="div" :to="{name:'faq'}">
                    <div class="faq">
                        <i class="zx-icon icon-l">&#xe61c;</i>
                        <span>常见问题</span>
                    </div>
                    <i class="zx-icon icon-r">&#xe6be;</i>
                </router-link>
                <router-link class="item" tag="div" to="">
                    <div class="faq invite">
                        <i class="zx-icon icon-l">&#xe61d;</i>
                        <span>邀请好友</span>
                    </div>
                    <i class="zx-icon icon-r">&#xe6be;</i>
                </router-link>
                <router-link class="item" tag="div" to="">
                    <div class="faq about">
                        <i class="zx-icon icon-l">&#xe693;</i>
                        <span>关于知行</span>
                    </div>
                    <i class="zx-icon icon-r">&#xe6be;</i>
                </router-link>
            </div>
            <div class="box">
                <router-link class="item" tag="div" to="/change">
                    <div class="faq change">
                        <i class="zx-icon icon-l">&#xe6a0;</i>
                        <span>身份切换</span>
                    </div>
                    <i class="zx-icon icon-r">&#xe6be;</i>
                </router-link>
                <div @click="quit" class="item">
                    <div class="faq exit">
                        <i class="zx-icon icon-l">&#xe6d0;</i>
                        <span>退出账号</span>
                    </div>
                    <!--<i class="zx-icon icon-r">&#xe6be;</i>-->
                </div>

            </div>
        </div>
    </div>
</template>
<script>
    export default {
        data(){
          return{
              info:{

              }
          }
        },
        created(){
            document.body.style.backgroundColor='rgb(239, 243, 246)'
            this.companyInfo()
        }
        ,methods:{
            companyInfo(){
                this.$post('/api/company/info',{uid:JSON.parse(localStorage.getItem('user')).uid}).then(res=>{
                    if(res.data.err_code ==0){
                        console.log(res.data.data)
                        this.info=res.data.data;
                    }else{
                        this.$toast({message: res.data.err_msg})
                    }
                }).catch(err=>{
                    console.log(err)
                })
            },
            gotoCompanyAuth(){
                this.$router.push({name:'company_auth'})
            },
            gotoBill(){
                this.$router.push({name:'bill'})
            },
            gotoUserInfo(){
                this.$router.push({name:'user_info_edit'})
            },
            quit(){
                this.$dialog.confirm({
                    title: '退出登录',
                    message: '您确认要退出登录吗?'
                }).then(() => {
                    // on confirm
                    console.log('确认')
                }).catch(() => {
                    // on cancel
                    console.log('取消')
                });
            }
        }
    }
</script>

<style lang="less" scoped>
    @import url('../../public/css/company.less');
</style>
